let years = [];
let curYear;

(function() {
  const date = new Date();
  curYear = date.getFullYear();
  
  for (let i = 19; i >= 0; i--) {
    years.push(curYear - i);
  }
  
})();

function getDays(year, month) {
  let daysInMonth;
  const bigMonth = month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12;
  
  if (month == 2) {
    daysInMonth = year % 4 == 0 ? 29 : 28;
  } else {
    daysInMonth = bigMonth ? 31 : 30;
  }

  const arr = [];
  for (let i = 1; i <= daysInMonth; i++) {
    arr.push(i);
  }

  return arr;
}